package com.link2room.aeriabots.controller.inside;

import com.link2room.aeriabots.dto.param.base.WxComponentParamDto;
import com.link2room.aeriabots.dto.result.base.WXOfficialAccountInfoDto;

import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.aeriabots.facade.IWXComponentFacadeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by LN on 2017/3/03.
 */
@Api(tags ={"微信公众号信息"} )
@RestController
@RequestMapping("/in/OfficialAccountsInfos")
public class WxOfficialAccountsInfoInsideController {
    @Resource
    private IWXComponentFacadeService wxComponentFacadeService;

    @ApiOperation(value="微信公众号信息",response = WXOfficialAccountInfoDto .class)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "集团代码",required = true,value = "lhotelGroupCode", dataType = "String",paramType="query"),
    })
    @RequestMapping(method = RequestMethod.GET)
    public BaseResultDto getOfficialAccountsToken(
    ) throws Exception {
        WxComponentParamDto param = new WxComponentParamDto();
        WXOfficialAccountInfoDto redDto = wxComponentFacadeService.getWXOfficialAccountInfoDto(param);
        BaseResultDto res = new BaseResultDto();
        res.setResultInfo(redDto);
        res.setResultCode(0);
        return res;
    }
}
